<?php
use  yii\helpers\Url;
use  yii\helpers\Html;
$banner = new \backend\modules\models\setting\LoopBanner();
$list   = $banner->getLoopBanner(); 
?>
<div id="myCarousel" class="carousel slide" data-ride="carousel" data-interval="false">
    <ol class="carousel-indicators">
        <?php if ($list) {?>
            <?php foreach ($list as $one => $first): ?>
                <?php if ($one == 0) {?>
                    <li data-target="#myCarousel" data-slide-to="<?= Html::encode($one)?>" class="active"></li>
                <?php }else {?>
                    <li data-target="#myCarousel" data-slide-to="<?= Html::encode($one)?>" class=""></li>
                <?php }?>
            <?php endforeach ?>
        <?php }?>
    </ol>

    <div class="carousel-inner container-lg">
        <?php if ($list) {?>
            <?php foreach ($list as $one => $first): ?>
                <?php if ($one == 0) {?>
                    <div class="carousel-item active" data-id="<?= Html::encode($one)?>">
                <?php }else {?>
                    <div class="carousel-item" data-id="<?= Html::encode($one)?>">
                <?php }?>
                    <img src="<?= Html::encode($first->url)?>" class="d-block w-100" />
                </div>
            <?php endforeach ?>
        <?php }?>
    </div>
    <a class="carousel-control-prev" href="#myCarousel" role="button" data-slide="prev">
        <span class="carousel-control-prev-icon" aria-hidden="true"></span>
        <span class="sr-only">Previous</span>
    </a>
    <a class="carousel-control-next" href="#myCarousel" role="button" data-slide="next">
        <span class="carousel-control-next-icon" aria-hidden="true"></span>
        <span class="sr-only">Next</span>
    </a>
</div>


